<script setup lang="ts">

import {useAuthStore} from "@/stores/auth";

const auth = useAuthStore()



</script>

<template>
    <el-container class="page">
      <el-header>
        <el-space style="height: 100%;width: 100%;justify-content: space-between"  alignment="center" >
          <el-text>问卷后台管理系统</el-text>
          <el-button @click="auth.clearToken();$router.push('/login')" type="success">退出登录 {{auth.token}}</el-button>
        </el-space>
      </el-header>
      <el-container>
        <el-aside width="200px">
          <el-menu
            :default-active="$route.fullPath"
            router
          >
            <el-menu-item index="/publish-survey">
              <template #title>已发布问卷</template>
            </el-menu-item>
            <el-menu-item index="/end-survey">
              <template #title>已结束问卷</template>
            </el-menu-item>
            <el-menu-item index="/self">
              <template #title>用户信息</template>
            </el-menu-item>
          </el-menu>
        </el-aside>
        <el-main>
          <router-view />
        </el-main>
      </el-container>
    </el-container>
</template>
